using FluentValidation;
using Gateway.Common.Enums;
using Gateway.IApplication.Tenant.Input;
using Gateway.IApplication.Validation;

namespace Gateway.IApplication.BaseInput.Validation;
/// <summary>
/// 基础的租户验证
/// </summary>
/// <typeparam name="T"></typeparam>
public class DisableValidation<T> :  AbstractValidator<DisableInput>,IFluentValidation
{
    /// <summary>
    /// 
    /// </summary>
    public DisableValidation()
    {
        RuleFor(x => x.Id).NotEmpty().WithMessage("标识不能为空");
        RuleFor(x => x.Disable).NotEmpty().Must(x =>
        {
            var data = BooleanStatusEnum.FromValue(x);
            return data != null;
        });
    }
}